/* === Search Bar === */
@searchbarBg: #ffffff;
@searchbarBorderColor: #E2E2E2;
@searchbarSize: 48px; //custom
@searchbarParholder:#bdbdbd;
.searchbar {
    height: @searchbarSize;
    width: 100%;
    background: @searchbarBg;
    box-sizing: border-box;
    .hairline(bottom, @searchbarBorderColor);
    //padding: 0 8px;
    padding: 0 16px 0 10px; //custom
    overflow: hidden;
    position: relative;
    .flexbox();
    .align-items(center);
    .searchbar-input {
        width: auto;
        height: 28px;
        position: relative;
        flex:1;
        .flex-shrink(1);
    }
    input[type="search"] {
        box-sizing: border-box;
        width: 100%;
        height: 100%;
        display: block;
        border: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        -ms-appearance: none;
        appearance: none;
        border-radius: 5px;
        font-family: inherit;
        color:#263A43;
        font-size: 14px;
        font-weight: normal;
        padding: 0 28px;
        background-color: #fff;
        background-repeat: no-repeat;
        background-position: 5px center;
        .encoded-svg-background('<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><title>ic_searching</title><desc>Created with Sketch.</desc><defs></defs><g id="Page-4" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="ic_searching"><rect id="Rectangle-1" fill-opacity="0" fill="#FFFFFF" x="0" y="0" width="20" height="20"></rect><path d="M12.8180221,13.6286823 C11.7806556,14.4853427 10.4504301,15 9,15 C5.6862915,15 3,12.3137085 3,9 C3,5.6862915 5.6862915,3 9,3 C12.3137085,3 15,5.6862915 15,9 C15,10.3224446 14.5721619,11.5449622 13.8473493,12.5366892 L16.8643171,15.5536569 C17.1610781,15.8504179 17.1662556,16.3263851 16.8713203,16.6213203 C16.5784271,16.9142136 16.1007315,16.9113916 15.8036569,16.6143171 L12.8180221,13.6286823 Z M9,13.5 C11.4852814,13.5 13.5,11.4852814 13.5,9 C13.5,6.51471863 11.4852814,4.5 9,4.5 C6.51471863,4.5 4.5,6.51471863 4.5,9 C4.5,11.4852814 6.51471863,13.5 9,13.5 Z" id="Combined-Shape" fill="#B7BBBE"></path></g></g></svg>');
        -webkit-background-size: 20px 20px;
        background-size: 20px 20px;
        &::-webkit-input-placeholder {
            color: @searchbarParholder;
            opacity: 1;
        }
        &::-webkit-search-cancel-button {
            -webkit-appearance:none;
        }
    }
    .searchbar-clear {
        position: absolute;
        width: 28px;
        height: 28px;
        right: 0;
        top: 0;
        opacity: 0;
        pointer-events:none;
        background-position: center;
        background-repeat: no-repeat;
        .encoded-svg-background('<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><title>ic_emptyInput</title><desc>Created with Sketch.</desc><defs></defs><g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="搜索框-全-已输入" transform="translate(-260.000000, -16.000000)" fill="#BDBDBD"><g id="ic_emptyInput"><path d="M268,22.5857864 L265.87868,20.4644661 L264.464466,21.8786797 L266.585786,24 L264.464466,26.1213203 L265.87868,27.5355339 L268,25.4142136 L270.12132,27.5355339 L271.535534,26.1213203 L269.414214,24 L271.535534,21.8786797 L270.12132,20.4644661 L268,22.5857864 Z M268,32 C272.418278,32 276,28.418278 276,24 C276,19.581722 272.418278,16 268,16 C263.581722,16 260,19.581722 260,24 C260,28.418278 263.581722,32 268,32 Z"></path></g></g></g></svg>');
        -webkit-background-size: 14px 14px;
        background-size: 14px 14px;
        .transition(300ms);
        cursor: pointer;
    }
    .searchbar-cancel {
        .transition(300ms);
        .translate3d(0,0,0);
        font-size: 17px;
        cursor: pointer;
        opacity: 0;
        .flex-shrink(0);
        margin-left: 0;
        pointer-events:none;
        display: none;
    }
    //custom button
    .searchbar-submit {
        opacity: .35;
        pointer-events: none;
        display: block;
        font-size: 12px;
        background: #1ED282;
        border-radius: 2px;
        border: none;
        margin-left: 8px;
        line-height: 26px;
        height: 28px;
        min-width: 52px;
        border: 1px solid #1ED282;
    }
    &.searchbar-active {
        .searchbar-cancel {
            margin-left: 8px;
            opacity: 1;
            pointer-events: auto;
            html:not(.watch-active-state) &:active, &.active-state {
                opacity: 0.3;
                .transition(0ms);
            }
        }
    }
    &.searchbar-not-empty {
        .searchbar-clear {
            pointer-events: auto;
            opacity: 1;
        }
        .searchbar-submit {
            opacity: 1;
            pointer-events: inherit;
            &.active-state {
                opacity: .65;
            }
        }
    }
}
.searchbar-overlay {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    opacity: 0;
    pointer-events:none;
    background: rgba(0,0,0,0.4);
    .transition(300ms);
    .translate3d(0,0,0);
    &.searchbar-overlay-active {
        opacity: 1;
        pointer-events: auto;
    }
}
.searchbar-not-found {
    display: none;
}
.hidden-by-searchbar, .list-block .hidden-by-searchbar, .list-block li.hidden-by-searchbar {
    display: none;
}
.page > .searchbar {
    position: absolute;
    width: 100%;
    left: 0;
    top: 0;
    z-index: 200;
    & ~ .page-content {
        padding-top: @searchbarSize;
    }
}
.navbar-fixed, .navbar-through {
    .page > .searchbar, > .searchbar {
        top: @toolbarSize;
        & ~ .page-content {
            padding-top: @searchbarSize + @toolbarSize;
        }
    }
}
